<?php

namespace app\common\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'idcard_face'       => 'require|length:0, 255',
        'idcard_emblem'     => 'require|length:0, 255',
        'business_license'  => 'require|length:0, 255',
        'contract_file'     => 'require|length:0, 255',
        'bank_image'        => 'require|length:0, 255',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'idcard_face.require'           => '请上传身份证人脸照',
        'idcard_emblem.require'         => '请上传身份证国徽照',
        'business_license.require'      => '请上传营业执照',
        'contract_file.require'         => '请上传合同文件',
        'bank_image.require'            => '请上传银行卡照片',
        'idcard_face.length'            => '身份证人脸照上传错误',
        'idcard_emblem.length'          => '身份证国徽照上传错误',
        'business_license.length'       => '营业执照上传错误',
        'contract_file.length'          => '合同文件上传错误',
        'bank_image.length'             => '银行卡照片上传错误',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'upload'    => ['idcard_face', 'idcard_emblem', 'business_license', 'contract_file', 'bank_image']
    ];

}
